package GUI;

import DAO.ConsultaAppporClinic;

import Logica.consultaAppClinic;

import java.awt.Color;
import java.awt.Dimension;

import java.awt.Font;
import java.awt.Rectangle;

import java.sql.Date;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class MostrarResAppClinic extends JFrame {

  private JTable resultados;
  private JLabel jLabel1 = new JLabel();

  public MostrarResAppClinic( Object fechainicio, Object fechafin,
                               Object clinic) {
  // //Object fechainicio, Object fechafin,
  //                              Object clinic
    try {
      jbInit(fechainicio,fechafin,clinic);//consulta
      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  private void jbInit( Object fechainicio, Object fechafin,
                               Object clinic) throws Exception {//Object[][] consulta
    this.getContentPane().setLayout(null);
    this.setSize(new Dimension(788, 700));
    consultaAppClinic a = new consultaAppClinic();
    System.out.println(" llego al init");    
    a.ConsultaAppporClinic(String.valueOf(fechainicio), String.valueOf(fechafin),
                             String.valueOf(String.valueOf(clinic)));
    String[] tit =
    { " APPOINMENT NUMBER", "DATE", "TYPEA", "CLINIC NUMBER", "OWNER NAME",
      "HOUR START", "MIN START", "DURACION", "PET ID" };
    
    //DefaultTableModel dtm = new DefaultTableModel(info, tit);

    //resultados = new JTable(dtm);

    resultados.setPreferredScrollableViewportSize(new Dimension(300,
                                                                100)); // las dimensiones
    resultados.setBounds(new Rectangle(10, 100, 600, 350));
    resultados.setSize(new Dimension(700, 350));

    jLabel1.setText("Mostrar Citas por Clinica");
    jLabel1.setBounds(new Rectangle(195, 25, 355, 40));
    jLabel1.setFont(new Font("ALGERIAN", 0, 20));
    jLabel1.setForeground(new Color(236, 33, 208));
    this.getContentPane().add(jLabel1, null);
    this.getContentPane().add(resultados, null);

    this.setVisible(true);

  }
}
